<template>
  <open-modal v-if="collageObject" :openModal='isShowStair' @closeModal='closeModal'>
    <article class="c-w100 c-bg-white c-ph24 c-pv24">
      <section class="c-flex-row c-justify-sb">
        <div class="c-flex-row">
          <div class="c-ww104 c-hh70 c-text-hidden c-flex-row c-flex-center c-flex-shrink0">
            <div class="c-w100 c-p">
              <img class="c-w100 imgCloseBig" :src="$addXossFilter(collageObject.collage.cover)" alt="" />
            </div>
          </div>
          <div class="c-flex-column c-hh70 c-justify-sb c-ml20">
            <div class="c-flex-row c-aligni-center">
              <span v-if="collageObject.collage.captainPriceType == 1" class="c-fs26 theme-fc"><span class="c-fs20">￥</span >{{ collageObject.collage.captainPrice }}</span>
              <div v-else class="c-fs26 theme-fc" v-for="(item, index) in collageObject.collage.collageGrades" :key="index" v-show="choosePriceIndex == index">
                <span class="c-fs20">￥</span>{{ item.captainPrice }}
              </div>
              <span class="c-fc-white theme-bg c-fs16 c-pv2 c-ph6 c-br16 c-ml12">团长价</span>
            </div>
            <span class="c-fs16 c-fc-gray">原价：{{ "￥" | iosPriceFilter}}{{ collageObject.collage.prodPrice }}</span
            >
          </div>
        </div>
        <span class="iconfont c-fs30 c-fc-sblack" @click="closeModal" >&#xe6e1;</span>
      </section>
      <section class="c-pt40 c-pb36">
        <div class="c-fs22 c-fc-xblack c-mb30">拼团类型（团员价）</div>
        <div class="c-flex-row c-flexw-wrap">
          <div class="c-pv10 c-ph30 c-fs24 c-br30 c-mr24 c-mb24" :class="choosePriceIndex == index ? 'theme-bd1 theme-fc priceBg' : 'c-fc-xblack c-bg-f6'" v-for="(item, index) in collageObject.collage.collageGrades" :key="index" @click="clickChooseItem(index)">
            ￥{{ Number(item.price) }}/{{ item.grade }}人团
          </div>
        </div>
      </section>
      <footer class="c-fs24 c-fc-white c-textAlign-c c-pv16 c-w100 c-br40 theme-bg" @click="clickNext">下一步</footer>
    </article>

  </open-modal>
</template>
<script>
import OpenModal from "@/components/templates/common/openModal.vue";
export default {
  name: "SelectStairCollage",
  components: {
    OpenModal,
  },
  props: {
    isShowStair: {
      type: Boolean,
      default: false,
    },
    collageObject: {
      type: Object,
      default: () => {
        return null;
      },
    },
  },
  data() {
    return {
      choosePriceIndex:0,
    }
  },
  methods:{
    closeModal() {
      this.$emit('update:isShowStair', false)
    },
    clickChooseItem(index) {
      this.choosePriceIndex = index;
    },
    clickNext() {
      this.$emit('clickNext', this.choosePriceIndex);
    },
  }
};
</script>
